home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #11
/
Amiga Plus CD - 2004 - No. 11.iso
/
AmiSoft
/
Text
/
edit
/
BareED.lha
/
BareED
/
Rexx
/
CountWords.rx
< prev
next >
Wrap
Text File
|
2003-11-29
|
645b
|
47 lines
/* Demo - to get amount of words in a file */
BAREED_HOST = GetClip('BAREED')
IF BAREED_HOST = '' THEN DO
CALL SetClip('BAREED') /* Remove from ClipNode */
EXIT 5
END
ADDRESS VALUE BAREED_HOST
CALL SetClip('BAREED') /* Remove from ClipNode */
OPTIONS RESULTS
/* ---------------------- MAIN --------------------- */
count = 0
move cursor archiveend
posy = 1
newy = 0
do while newy < posy
'find previous word'
fault = rc
if fault ~= 0 then do
get cursor y
posy = result
move cursor left
get cursor y
newy = result
end
if fault = 0 then
count = count + 1
end
tell "Counted" count "word- and number strings"